<?php 
if(date("Y-m-d") < format_date($_SESSION['__current_year__']->get_fine_quadrimestre(), IT_DATE_STYLE, SQL_DATE_STYLE, "-")){
	$q = 1;
}
else{
	$q = 2;
}
$classi = $_SESSION['__user__']->getClasses();
?>
<div class="small box">
<h2 style="font-size: 16px">Working</h2>
<ul class="menublock">
	<li><a href="#" style="font-size: 11px">Le tue classi</a></li>
	<?php 
    if(count($classi) < 4){
    	while(list($k, $v) = each($classi)){
    ?>
		<li style="padding-left: 20px"><a href="classe.php?cls=<?php print $k ?>" style="font-size: 11px; font-weight: normal">Classe <?php print $v['classe'] ?></a></li>
	<?php 
	    }
    }
    else{
    	$idx = 0;
    	print("<li style='padding-left: 20px'>");
    	while(list($k, $v) = each($classi)){
    		if(($idx % 3) == 0 && $idx != 0){
    			print("</li>\n<li style='padding-left: 20px'>");
    		}
	?>
		<a href="classe.php?cls=<?php print $k ?>" style="font-size: 11px; font-weight: normal"><?php print $v['classe'] ?></a>&nbsp;&nbsp;&nbsp;
	<?php 
			$idx++;	
    	}
    	
    	print("</li>");
    } 
    ?>
  	<li><a href="#" style="font-size: 11px">Registro di classe</a></li>
    <?php 
    reset($classi);
    if(count($classi) < 4){
    	while(list($k, $v) = each($classi)){
    ?>
		<li style="padding-left: 20px"><a href="registro_classe/today.php?cls=<?php print $k ?>" style="font-size: 11px; font-weight: normal">Classe <?php print $v['classe'] ?></a></li>
	<?php 
	    }
    }
    else{
    	$idx = 0;
    	print("<li style='padding-left: 20px'>");
    	while(list($k, $v) = each($classi)){
    		if(($idx % 3) == 0 && $idx != 0){
    			print("</li>\n<li style='padding-left: 20px'>");
    		}
	?>
		<a href="registro_classe/today.php?cls=<?php print $k ?>" style="font-size: 11px; font-weight: normal"><?php print $v['classe'] ?></a>&nbsp;&nbsp;&nbsp;
	<?php 
			$idx++;	
    	}
    	
    	print("</li>");
    } 
    ?>
  	<li><a href="#" style="font-size: 11px">Registro personale</a></li>
  	<?php 
  	reset($classi);
    if(count($classi) < 4){
    	while(list($k, $v) = each($classi)){
    ?>
		<li style="padding-left: 20px"><a href="registro_personale/index.php?cls=<?php print $k ?>&q=<?php print $q ?>" style="font-size: 11px; font-weight: normal">Classe <?php print $v['classe'] ?></a></li>
	<?php 
	    }
    }
    else{
    	$idx = 0;
    	print("<li style='padding-left: 20px'>");
    	while(list($k, $v) = each($classi)){
    		if(($idx % 3) == 0 && $idx != 0){
    			print("</li>\n<li style='padding-left: 20px'>");
    		}
	?>
		<a href="registro_personale/index.php?cls=<?php print $k ?>&q=<?php print $q ?>" style="font-size: 11px; font-weight: normal"><?php print $v['classe'] ?></a>&nbsp;&nbsp;&nbsp;
	<?php 
			$idx++;	
    	}
    	
    	print("</li>");
    } 
    ?>
    <li><a href="circolari.php" style="font-size: 11px">Circolari</a></li>
</ul>
</div>